<?php

namespace IDock\Insurance\MACN\Request;

use Exception;
use IDock\Insurance\MACN\Response\EPolicyDownloadResponse;
use IDock\Insurance\MACN\Response\ProposalRecallResponse;
use IDock\Visitor\EPolicyDownloadVisitor;
use IDock\Visitor\ProposalRecallVisitor;

class EPolicyDownloadRequest extends AllMACNRequest
{
    protected $requestType = '0057';

    protected $response = EPolicyDownloadResponse::class;

    protected $urlTip = '电子保单下载';

    /*** @var EPolicyDownloadVisitor  $visitor */
    protected $visitor;

    /**
     * @return array
     * @throws Exception
     */
    public function generate(): array
    {
        $arr = [
            'baseInfo' => [
                'preProposalTopNo' =>  $this->visitor->argc['preProposalTopNo'] ?? '',
            ]
        ];
        if(!empty($this->visitor->argc['noCarProposalNo'])){
            $arr['baseInfo']['noCarProposalNo'] = $this->visitor->argc['noCarProposalNo'];
        }
        return $arr;
    }
}
